#pragma once

#include "Core\NervusSharedHeader.h"

namespace Nervus {
	namespace Render {

		struct MeshVertex
		{
			f32 x, y, z; //Coords in space
			DWORD color; //Color
			f32 tu, tv; //Texture coordinates
			u32 spr;
		};

		
		/*
		Vertices must be listed in ClockWise order
		Example for quad - vertices goes as Z-letter starting from left-top
		*/
		class Mesh {
			friend class D3D9RenderSystem;
			friend class D3D11RenderSystem;

		private:

		protected:
			vector<MeshVertex> mVertices;
			DWORD* mIndexes;
			Material* mMaterial;


			Mesh();
			virtual ~Mesh();

		public:
			virtual bool loadMesh() = 0;
			virtual void renderMesh() = 0;
			void setMaterial(Material*);
		};
	}
}